package org.zfes.snowier.cloud.zbss.cms.router.service.column;

import java.util.Map;
import java.util.Optional;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.zfes.snowier.core.data.DataSet;
import org.zfes.snowier.web.controller.BaseController;
import org.zfes.snowier.cloud.zbss.cms.column.model.CmsColumnGroupView;
import org.zfes.snowier.cloud.zbss.cms.column.service.ICmsColumnGroupViewService;
@Controller("org.zfes.snowier.cloud.zbss.cms.column.router.service.CmsColumnGroupViewController")   
@RequestMapping("/cms/service/column/cmsColumnGroupView")
public class CmsColumnGroupViewController extends BaseController {

	
	@Autowired
	private ICmsColumnGroupViewService cmsColumnGroupViewService;
	
	@RequiresPermissions(value="cmsColumnGroupView:loadCmsColumnGroupViewDataSet",desc="栏目用户组浏览设置列表")
    @RequestMapping(value="/loadCmsColumnGroupViewDataSet", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object loadCmsColumnGroupViewDataSet(@RequestParam Map<String,Object> params){
	    DataSet dataSet=  cmsColumnGroupViewService.loadCmsColumnGroupViewDataSet(params);
	    return ajaxQuery("dataSet", dataSet);
    }
	
	@RequiresPermissions(value="cmsColumnGroupView:createCmsColumnGroupView",desc="栏目用户组浏览设置添加")
    @RequestMapping(value="/createCmsColumnGroupView", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public  @ResponseBody Object createCmsColumnGroupView(CmsColumnGroupView cmsColumnGroupView){
		cmsColumnGroupViewService.createCmsColumnGroupView(cmsColumnGroupView);
    	return ajaxDoneSuccess("数据操作成功 ");
    }
	
	@RequiresPermissions(value="cmsColumnGroupView:loadCmsColumnGroupView",desc="栏目用户组浏览设置加载")
    @RequestMapping(value="/loadCmsColumnGroupView", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object loadCmsColumnGroupView(Long id){
		Optional<CmsColumnGroupView> ops = cmsColumnGroupViewService.loadCmsColumnGroupViewById(id);
		return ajaxQuery("cmsColumnGroupView",ops);
    }
	
	@RequiresPermissions(value="cmsColumnGroupView:updateCmsColumnGroupView",desc="栏目用户组浏览设置更新")
    @RequestMapping(value="/updateCmsColumnGroupView", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object updateCmsColumnGroupView(CmsColumnGroupView cmsColumnGroupView){
		cmsColumnGroupViewService.updateCmsColumnGroupView(cmsColumnGroupView);
		return ajaxDoneSuccess("数据操作成功 ");
    }
	
	@RequiresPermissions(value="cmsColumnGroupView:deletCmsColumnGroupView",desc="栏目用户组浏览设置删除")
    @RequestMapping(value="/deleteCmsColumnGroupView", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object deleteCmsColumnGroupView(Long id){
		cmsColumnGroupViewService.deleteCmsColumnGroupView(id);
		return ajaxDoneSuccess("数据操作成功 ");
    }

}